#include <stdio.h>
#include <string.h>
#include "ClienteAhorcado.h"
#include "ServerAhorcado.h"
#include "GameMessageId.h"
#include "GameMessage.h"
#include <conio.h>

/*int main(void)
{
	bool pressed = false;
	char c;
	while(!pressed){
		if(kbhit()){
			pressed = true;
			c=getch();
		}
	}
	printf("el ascii asociado a la tecla precionada es %d",c); //8 backspace, 13 enter, 27 esc
	getchar();
}*/

/*
Message *ms = new Message(GameMessages::ID_GAME_MESSAGE_1,std::string("juan"));
	printf("%s",ms->toCharPointer());
	char* prueba = ms->toCharPointer();
	Message* ms2 = new Message(prueba);
	printf("%s",ms2->toCharPointer());

*/

int main(void)
{
	char str[512];

	bool isServer;

	printf("(C) or (S)erver?\n");
	gets(str);

	if ((str[0]=='c')||(str[0]=='C'))
	{
		ClienteAhorcado* CA = new ClienteAhorcado();
		CA->play();
	} else if((str[0]=='s')||(str[0]=='S')) {
		ServerAhorcado* SA = new ServerAhorcado();
		SA->startServer();
	}
	printf("Saliendo del Juego\n");
	getchar();
	return 0;
}